home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / source / kernel / history.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-24  |  2.3 KB  |  77 lines  |  [TEXT/KAHL]

  1. /* Definitions for the historical record.
  2.    Copyright (C) 1992, 1993, 1994, 1995 Stanley T. Shebs.
  3.  
  4. Xconq is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.  See the file COPYING.  */
  8.  
  9. typedef enum {
  10.  
  11. #undef  DEF_HEVT
  12. #define DEF_HEVT(name, CODE, datadescs) CODE,
  13.  
  14. #include "history.def"
  15.  
  16.     NUMHEVTTYPES
  17. } HistEventType;
  18.  
  19. /* This is the form of the definition of a event type. */
  20.  
  21. typedef struct a_hevt_defn {
  22.     char *name;
  23.     char *datadescs;
  24. } HevtDefn;
  25.  
  26. typedef struct a_histevent {
  27.     HistEventType type;
  28.     int subtype;
  29.     int summary;
  30.     int startdate;
  31.     int startseq;
  32.     int enddate;
  33.     int endseq;
  34. #if (MAXSIDES < 32)
  35.     long observers;
  36. #else
  37.     int observers[MAXSIDES];
  38. #endif
  39.     struct a_histevent *cause;
  40.     struct a_histevent *next;
  41.     struct a_histevent *prev;
  42.     long data[4];
  43. } HistEvent;
  44.  
  45. /* This is a snapshot of key bits of a unit's state at a particular
  46.    moment. */
  47.  
  48. typedef struct a_pastunit {
  49.     short type;                /* type */
  50.     short id;                  /* truly unique id number */
  51.     char *name;                /* the name, if given */
  52.     long number;               /* semi-unique number */
  53.     short x, y, z;             /* position of unit in world */
  54.     struct a_side *side;       /* whose side this unit is on */
  55.     struct a_pastunit *next;
  56. } PastUnit;
  57.  
  58. extern HevtDefn hevtdefns[];
  59.  
  60. extern HistEvent *history;
  61.  
  62. extern PastUnit *past_unit_list;
  63.  
  64. extern void init_history PROTO ((void));
  65. extern HistEvent *create_historical_event PROTO ((HistEventType type));
  66. extern HistEvent *record_event PROTO ((HistEventType type, SideMask observers, ...));
  67. extern void record_unit_loss PROTO ((Unit *unit, int reason));
  68. extern void record_unit_name_change PROTO ((Unit *unit, char *newname));
  69. extern void end_history PROTO ((void));
  70. extern HistEvent *get_nth_history_line PROTO ((Side *side, int n, HistEvent **nextevt));
  71. extern PastUnit *create_past_unit PROTO ((int type, int id));
  72. extern PastUnit *find_past_unit PROTO ((int n));
  73. extern char *past_unit_desig PROTO ((PastUnit *pastunit));
  74. extern PastUnit *change_unit_to_past_unit PROTO ((Unit *unit));
  75. extern void dump_statistics PROTO ((void));
  76.  
  77.